package com.game.cards.monsters;

import java.util.Scanner;

import com.game.cards.Attribute;
import com.game.cards.Flags;
import com.game.cards.MonsterCard;
import com.game.cards.Type;
import com.game.play.Events;
import com.game.play.Game;
import com.game.play.Player;

public class PyroTechGunner extends MonsterCard {
	public PyroTechGunner()
	{
		this.title = "Pyro Tech Gunner";
		this.description = "This monster can only attack your opponents life points directly.\n" +
		"\n You can also choose to sacrifice one monster on your side of the field to deal 1000 damage to your \n" +
				"Opponents life points.";
		
		this.attack = 1650;
		this.defense = 2750;
		
		this.stars = 7;
		
		this.flags.add(Flags.effect);
		this.flags.add(Flags.direct);
		
		this.attribute = Attribute.fire;
		
		this.type = Type.Pyro;
	}
	public void effect(Game game)
	{
		Player owner = game.getCurrentTurn();
		if (owner.getField().getMonsterCards().size() >= 2) {
			System.out.println("Which monster will you sacrifice? Type -1 to cancel.");
			int i = 0;
			for (MonsterCard c : owner.getField().getMonsterCards())
			{
				if (!c.equals(this))System.out.println("(" +i+ ")" +c.getTitle());
				i++;
			}
			Scanner scan = new Scanner(System.in);
			int input = scan.nextInt();
			if (input != -1) {
				MonsterCard t = owner.getField().getMonsterCards().get(input);
				owner.getField().removeMonsterById(t.getId());
				owner.getField().getGraveyard().add(t);
				owner.getAq().getEffects().remove(t);
				owner.getAq().addEvent(Events.destroycard +","+t.getId());
				
				game.getOffTurn().setLifePoints(game.getOffTurn().getLifePoints()-1000);
				System.out.println(owner.getName() + " sacrificed " +t.getTitle() + " to deal 1000 damage!");
				
				
			}
		}
	}

}
